package frame.laxcen.response;

import frame.laxcen.BaseFrame;
import frame.laxcen.dataobject.DataObject_0010_08;
import frame.laxcen.exception.IllegalFrameFormatException;
import frame.laxcen.response.annotation.FrameFeature;
import frame.laxcen.util.FrameReader;

import java.util.HashMap;
import java.util.Map;

// 返回读写器当前使用的天线
@FrameFeature(MessageType = 0b0010, Mid = 0x08)
public class Response_0010_08 extends BaseResponse {

    public Response_0010_08(BaseFrame baseFrame) throws IllegalFrameFormatException {

        super(baseFrame);

        getContentMap().putAll(explainToMap());
    }

    @Override
    protected Map<String, String> analyzeResponse(FrameReader reader) throws IllegalFrameFormatException {

        Map<String, String> result = new HashMap<>();

        // 天线使能配置

        result.put("天线使能配置", Integer.toBinaryString(reader.readU8()));

        return result;
    }

    public DataObject_0010_08 getDataObject() {

        return new DataObject_0010_08(getContentMap());
    }
}
